<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>

    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
    <meta name="description" content="叫上海[半价菜][送可乐]樱花日本料理外卖上外卖超人,全球领先订餐平台，提供宋园路地铁站
网上订餐,  [半价菜][送可乐]樱花日本料理外卖菜单, [半价菜][送可乐]樱花日本料理每日特价。马上登陆外卖超人，轻松三步即刻享受周边美食！" />
    <meta name="viewport" content="user-scalable=no">
    
    <meta name="google-site-verification" content="BstJA3X9z6f9HcvoN9AZTwaKo_9Abj_j7dVBPfy640s" />
    <meta name="baidu-site-verification" content="IYCrtVH0i1" />
    <meta property="wb:webmaster" content="239d3d1dbdde1b2c" />
    <link rel="icon" type="image/png" href="${pageContext.request.contextPath }/images/favicon.ico"/>
    
    <script type="text/javascript">
       
        (function(document, screen) {if (screen.width < 760) {document.location.href="/mobile/";}}(document, screen));
    </script>
    
    <link rel="stylesheet" href="${pageContext.request.contextPath }/css/common.css?v=2015-5-20"/>
    
    <link rel="stylesheet" href="${pageContext.request.contextPath }/css/menuPage.css?v=2015-5-20"/>

    
    <title>店铺商品</title>
</head>
<body class="day " ng-controller="bodyCtrl"  day-or-night>
    <section class="common-back" id="wrapBackground">
        
            <header id="header">
                <div class="common-width clearfix">
                    <h1 class="fl">
                        
                    </h1>

                        <ul class="member" login-box>
                            <li><a href="index.html" class="index">首页</a></li>
                            <li class="login-register"><a href="${pageContext.request.contextPath }/login_seller.jsp" referer-url  class="login"  rel="nofollow">登录</a><span class="cg">/</span><a href="register.html" referer-url  rel="nofollow" class="register">注册</a></li>
                            <li><a href="${pageContext.request.contextPath }/order/list" class="order-center"  rel="nofollow">查看挂单</a></li>
                           
                        </ul>
                    
                </div>
            </header>
        
        
        
            
    <section class="menupage-main common-width" ng-init="city_name='上海'">
        
<header class="nav clearfix">
    <div class="fl clearfix nav-des">
        <img src="${pageContext.request.contextPath }/images/01.jpg" alt="[半价菜][送可乐]樱花日本料理" class="fl" />
        <div class="fl nav-des-text">
            <h2 class="ellipsis" title="[半价菜][送可乐]樱花日本料理">樱花日本料理</h2>
            <div class="clearfix">
                <div class="fl nav-review">
                    <div style="width:65.00px;"></div>
                </div>
                <p class="nav-review-x">5星</p>
            </div>
        </div>
    </div>
    
    </div>
</header>
<ul class="clearfix menu-nav-list" scroll-position-static="160">
	 <li class="active"><a href="list">菜单</a></li>
    <li ><a href="${pageContext.request.contextPath }/food/getAddFood">添加菜品</a></li>

</ul>

        <section class="main-box clearfix" lazy-img-load>
            <div class="main fl">
                <div class="inner-main">
                    
                    <nav class="list-order-nav clearfix" id="list-order-nav">
                        <ul class="fl">
                            <li>菜单排序：</li>
                            <li><a href="javascript:void(0);" class="sort-default active">默认排序</a></li>
                            <li class="split-line">|</li>
                            
                            <li><a href="javascript:void(0);" class="sort-price">价格<i class="order-icon"></i></a></li>
                            <li class="split-line">|</li>
                        </ul>
                    </nav>
                    <div id="menu-main" class="menu-main">
                 
                    <article class="collapse section-25305">
                        <header accordion>
                            <h3 class="ellipsis" title="清蔬系列">
                                清蔬系列
                                
                            </h3>
                            <span ng-if="sectionCount['25305']" ng-class="{disinbl:sectionCount['25305']}"
                                  class="badge disnone" ng-bind="sectionCount['25305']"></span>
                            <i class="icon shrink-icon position"></i>
                        </header>
                        <section>
                              
                            <ul class="clearfix menu-group menu-group-img menu-first-load">
                     <c:forEach items="${requestScope.list1}" var="v">
                                    <li title="${v.foodName }" class="menu-item hasImg" accessorykey="25305-${v.foodId}" data-sale="6" data-price="${v.foodPrice }">
                                        <div class="menu-item-img"> 
                                            <img data-src="" src="${pageContext.request.contextPath }/${v.foodPic}" width="202" height="202" />   
                                        </div>
                                        <div class="meun-item-name"><span class="ellipsis">${v.foodName }</span></div>
                                        <p class="ellipsis meun-item-des"></p>
                                        <div class="meun-item-sale clearfix">
                                            <span class="last"></span>
                                            <span class="price">￥${v.foodPrice }</span>
                                            <span ng-if="menuItemCount['25305-${v.foodId }']" ng-class="{disinbl:menuItemCount['25305-${v.foodId }']}"
                                                  class="badge disnone" ng-bind="menuItemCount['25305-${v.foodId }']"></span>
                                            
                                            
                                        </div>
                                        
                                    </li>
                                    
                                 
                                       </c:forEach>     
                                
                            </ul>
                            
                            <ul class="clearfix menu-group">
 
                            </ul>
                        </section>
                    </article>
                
                    <article class="collapse section-25301">
                        <header accordion>
                            <h3 class="ellipsis" title="荤菜系列">
                                荤菜系列
                                
                            </h3>
                            <span ng-if="sectionCount['25301']" ng-class="{disinbl:sectionCount['25301']}"
                                  class="badge disnone" ng-bind="sectionCount['25301']"></span>
                            <i class="icon shrink-icon position"></i>
                        </header>
                        <section>
                              
                            <ul class="clearfix menu-group menu-group-img menu-first-load">
          
                   
                                     <c:forEach items="${requestScope.list2}" var="v">
                                    <li title="${v.foodName }" class="menu-item hasImg" accessorykey="25301-${v.foodId}" data-sale="6" data-price="${v.foodPrice }">
                                        <div class="menu-item-img"> 
                                            <img data-src="" src="${pageContext.request.contextPath }/${v.foodPic}" width="202" height="202" />   
                                        </div>
                                        <div class="meun-item-name"><span class="ellipsis">${v.foodName }</span></div>
                                        <p class="ellipsis meun-item-des"></p>
                                        <div class="meun-item-sale clearfix">
                                            <span class="last"></span>
                                            <span class="price">￥${v.foodPrice }</span>
                                            <span ng-if="menuItemCount['25301-${v.foodId }']" ng-class="{disinbl:menuItemCount['25301-${v.foodId }']}"
                                                  class="badge disnone" ng-bind="menuItemCount['25301-${v.foodId}']"></span>
                                            
                                            
                                        </div>
                                        
                                    </li>
                                    
                                 
                                       </c:forEach> 
   
   
                            </ul>
                            
                            <ul class="clearfix menu-group">
       
                            </ul>
                        </section>
                    </article>
                
                    <article class="collapse section-25300">
                        <header accordion>
                            <h3 class="ellipsis" title="主食饮料系列">
                                主食饮料系列
                                
                            </h3>
                            <span ng-if="sectionCount['25300']" ng-class="{disinbl:sectionCount['25300']}"
                                  class="badge disnone" ng-bind="sectionCount['25300']"></span>
                            <i class="icon shrink-icon position"></i>
                        </header>
                        <section>
                              
                            <ul class="clearfix menu-group menu-group-img menu-first-load">
           
                                    <c:forEach items="${requestScope.list3}" var="v">
                                    <li title="${v.foodName }" class="menu-item hasImg" accessorykey="25300-${v.foodId}" data-sale="6" data-price="${v.foodPrice }">
                                        <div class="menu-item-img"> 
                                            <img data-src="" src="${pageContext.request.contextPath }/${v.foodPic}" width="202" height="202" />   
                                        </div>
                                        <div class="meun-item-name"><span class="ellipsis">${v.foodName }</span></div>
                                        <p class="ellipsis meun-item-des"></p>
                                        <div class="meun-item-sale clearfix">
                                            <span class="last"></span>
                                            <span class="price">￥${v.foodPrice }</span>
                                            <span ng-if="menuItemCount['25300-${v.foodId }']" ng-class="{disinbl:menuItemCount['25300-${v.foodId }']}"
                                                  class="badge disnone" ng-bind="menuItemCount['25300-${v.foodId }']"></span>
              
                                        </div>
                                        
                                    </li>
                                                           
                                       </c:forEach>
   
                            </ul>
                            
                            <ul class="clearfix menu-group">
      
                                
                            </ul>
                        </section>
                    </article>
 
                    </div>
                </div>
            </div>
            <aside class="fl">
                <article class="cart" scroll-position-static="160" top="42">
                    <div class="menu-cart">
                        <header>
                            <!-- <h4 class="ellipsis w100p" title="[半价菜][送可乐]樱花日本料理">[半价菜][送可乐]樱花日本料理</h4> -->
                            <h5>
                               点单区
                               
                                <i class="icon trash-can-icon fr " ng-click="clearCart()"></i>
                            </h5>
                            
                        </header>
                        <section>
                            <div class="inner-cart empty" ng-class="{empty:isEmpty}">
                                <div class="cart-thead clearfix">
                                    <div class="goods-name fs16">商品名</div>
                                    <div class="goods-count fs16">份数</div>
                                    <div class="goods-price fs16">单价</div>
                                    <div class="goods-subtotal fs16">小计</div>
                                </div>
                                <div class="cart-item-list select-none">
                                    <div class="disnone" ng-class="{disnone:isEmpty}">
                                        <div class="cart-item cart-data clearfix" ng-repeat="obj in cartDatas">
                                            <div class="goods-name ellipsis" ng-bind="obj.name"></div>
                                            <input type="hidden" class="foodId" ng-bind="obj.id"/>
                                            <div class="goods-count clearfix ellipsis">
                                                <span class="goods-sub icon sub-icon fl" sub-goods="[[$index]]"></span>
                                                <span class="goods-nums fl" ng-bind="obj.quantity"></span>
                                                <span class="goods-add icon add-icon fl" ng-click="addGoodsNum($index)"></span>
                                            </div>
                                            <div class="goods-price">￥<span class="foodprice" ng-bind="obj.price|number:2"></span></div>
                                            <div class="goods-subtotal">￥<span ng-bind="(obj.quantity * obj.price)|number:2"></span></div>

                                            <div class="accessory-item" ng-class="{firstitem:$first}" ng-repeat="item in obj.options">
                                                <div class="cart-item clearfix">
                                                    <div class="goods-name ellipsis" ng-bind="item.name"></div>
                                                    <div class="goods-count fs20">
                                                       <span class="goods-sub fl"></span>
                                                       <span class="goods-nums fl" ng-bind="item.quantity"></span>
                                                    </div>
                                                    <div class="goods-price">￥<span  class="foodprice" ng-bind="item.price|number:2"></span></div>
                                                    <div class="goods-subtotal">￥<span ng-bind="(item.price * item.quantity)|number:2"></span></div>
                                                </div>
                                            </div>
                                        </div>
                                        <!--附加物-->
                                        <div class="cart-item cart-item-addendum cart-data clearfix" ng-repeat="addition in additions">
                                            <div class="goods-name ellipsis" ng-bind="addition.name"></div>
                                            <div class="goods-count clearfix ellipsis">
                                                <span class="goods-nums fl" ng-bind="addition.quantity"></span>
                                            </div>
                                            <div class="goods-price">￥<span class="foodprice"ng-bind="addition.price|number:2"></span></div>
                                            <div class="goods-subtotal">￥<span ng-bind="(addition.price * addition.quantity)|number:2"></span></div>
                                        </div>
                                        <!--附加物-->
                                    </div>
                                    <div class="cart-item-empty">暂无商品，请在左边的菜单上点单</div>
                                </div>
                                <div id="cart-item-list"></div>
                                <div class="total clearfix disnone" ng-class="{disnone:isEmpty}">
                                    <!--
                                    	<div class="fl">配送费：￥<span ng-bind="deliveryCost|number:2"></span></div>
                                    -->
                                    <div class="fr">合计：￥<span ng-bind="total|number:2" class="totalPrice"></span></div>
                                </div>
                                <div class="checkout">
                                   <button class="checkout btn" onclick="xdMethod()" >立即下单</button>
                                </div>
                            </div>
                            
						   <div class="" style="margin-top: 5px;margin-left: 5px;">
						   <!-- 显示可以用餐的桌子 -->
                            <label  class="">桌号</label>
							<select class="desk" name="desk">
								
							</select>
						</div>
						<div class="" style="margin-top: 5px;margin-left: 5px;">
						   <!-- 显示可以用餐的桌子 -->
                            <label  class="">当前号码：</label>
							<input type="text" name="" id="lineup" value=""  readonly=""/>
							<button id="updatelineup">叫号</button>
						</div>
                        </section>
                    </div>
                    
                    
                    
                </article>
            </aside>
        </section>
        <span id="element" style="position:absolute;display:none" class="badge">1</span>
        
    </section>

        </div>
    </section>
    
        <footer id="footer">
        
        
    </footer>
   
       
    
    <script type="text/javascript" src="${pageContext.request.contextPath }/js/angular.min.js"></script>
    <script src="${pageContext.request.contextPath }/js/common.js"></script>
    
    
    

    <script src="${pageContext.request.contextPath }/js/service.js"></script>
    
    <script>var feedbackUrl = '/ajax/feedback/';var app = angular.module("app", ["dh.dialog", "dh.form", 'dh.service', 'dh.other']);</script>
    <!--[if lt IE 9]><script src="js/fix.js"></script><![endif]-->
    
    
    <script>
        var sections = [{"description": null, "image": null, "recommended": false, "id": 25305, "menu_items": [ <c:forEach items="${requestScope.list1}" var="v">{"qiniu_url": "http://dhcmenuitem.dhero.cn/142660462463044115045526996255", "additions": [], "name": "${v.foodName}", "optionsets": [], "ordercount": 6, "position": 6, "price": ${v.foodPrice}, "id": ${v.foodId}, "description": ""}, </c:forEach>], "name": "清蔬系列"}, 
        {"description": null, "image": null, "recommended": false, "id": 25301, "menu_items": [<c:forEach items="${requestScope.list2}" var="v">{"qiniu_url": "http://dhcmenuitem.dhero.cn/14266031314005406017394270748", "additions": [], "name": "${v.foodName}", "optionsets": [], "ordercount": 44, "position": 18, "price": ${v.foodPrice}, "id":${v.foodId}, "description": ""}, </c:forEach>  ], "name": "荤菜系列"}, 
        {"description": null, "image": null, "recommended": false, "id": 25300, "menu_items": [<c:forEach items="${requestScope.list3}" var="v">{"qiniu_url": "http://dhcmenuitem.dhero.cn/142806926426326311941305175424", "additions": [], "name": "${v.foodName}", "optionsets": [], "ordercount": 33, "position": 18, "price": ${v.foodPrice}, "id":${v.foodId}, "description": ""}, </c:forEach> ], "name": "主食饮料系列"}, 
        ],accessoryObj = {},orderObj=[],other_order={};
        if(sections){
            for(var i = 0 , len = sections.length; i < len; i++){
                var sectionObj = sections[i] , key = '';
                for(var j = 0 , itemLen = sectionObj.menu_items.length; j < itemLen; j++){
                    var menuItemObj = sectionObj.menu_items[j];
                    key = sectionObj.id + '-' + menuItemObj.id;
                    menuItemObj.key = key;
                    menuItemObj.sectionId = sectionObj.id;
                    accessoryObj[key] = menuItemObj;
                } 
            }
        }

        if(other_order&&other_order.items){
            //order data
            for(var j=0;j<other_order.items.length;j++){
                if(other_order.items[j].status==true){
                    orderObj.push(other_order.items[j]);
                }
            }   
        }
        var restaurantId='1592';
        var restaurantInRange = true;
        var grid_locationId =  602341 ;
        var inRange = true;
        var can_process_order = true;
        var create_order_url = "/mobile/ajax/create_order/";
        var checkout_url = "/checkout/0/";
        var restaurant_list_url = "/restaurants/0/";
        var favoriteUrl = "/ajax/restaurant/0/favorite/";
        var delivery = {minimum_order_quantity:'150',free_delivery_treshold:'0',delivery_fee:'0' }
    </script>
    <script src="${pageContext.request.contextPath }/js/menupage.js"></script>
    <script src="${pageContext.request.contextPath }/js/favorite.js"></script>
	<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    
    <script>angular.bootstrap(document, ["app"]);</script>

    <!-- Baidu Analytics -->
    
    <script type="text/javascript">
		$(function(){
			
			
			
				$.ajax({
					type:"get",
					url:"getdesk",
					dataType:"json",
					success:function(result){
					  // console.log(result);
						
					   $.each(result, function(i,d) {
							
							//$(".desk").append("<li ><a href='Album.do?op=altype&tId="+d.tId+"'>"+d.tName+"</a></li>");
						   $(".desk").append("<option value="+d.deskId+">"+d.deskName+"</option>");
						});
					}
				});
				$.ajax({
					type:"get",
					url:"getlineup",
					dataType:"json",
					success:function(result){
					  // console.log(result);
						
					   
							
							//$(".desk").append("<li ><a href='Album.do?op=altype&tId="+d.tId+"'>"+d.tName+"</a></li>");
						   $("#lineup").val(result)
						
					}
				});
				$("#updatelineup").click(function(){
					
					$.ajax({
						type:"get",
						url:"updatelineup",
						dataType:"json",
						success:function(result){
						  // console.log(result);
							
						   
								
								//$(".desk").append("<li ><a href='Album.do?op=altype&tId="+d.tId+"'>"+d.tName+"</a></li>");
							   $("#lineup").val(result)
							
						}
					});
					 
					
				});
				
			
		})
		
		</script>
		<script>

	//下单操作
	function xdMethod(){
		var ids="";
		var nums="";
		var prices="";
		$.each($(".foodId"),function(i,v){
			ids+=$(this).text()+",";
		});
		
		$.each($(".goods-nums"),function(i,v){
			nums+=$(this).text()+",";
		});
		$.each($(".foodprice"),function(i,v){
			prices+=$(this).text()+",";
		});
		var totalPrice=parseFloat($(".totalPrice").text());
		location.href="${pageContext.request.contextPath }/food/order?nums="+nums+"&totalPrice="+totalPrice+"&ids="+ids+"&deskId="+$(".desk").val();
	}
</script>




</body>
</html>
